﻿/*
 * Created by SharpDevelop.
 * User: StrunevskyDV
 * Date: 02.03.2010
 * Time: 14:17
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using EmailJabber.Entities.Entities;

namespace EmailJabber.Logic.Logic.BusinessLogic
{
	/// <summary>
	/// Description of EntitiesBlo.
	/// </summary>
	public class EntitiesBlo
	{
		private static EntitiesBlo instance = new EntitiesBlo();

		public static EntitiesBlo Instance
		{
			get
			{
				return instance;
			}
		}

		private EntitiesBlo()
		{
		}
		
		public EntityBase GetEntityById(Guid id)
		{
			return DAL.DAL.Instance.GetEntityById(id);
		}
		
		public void StoreEntity(EntityBase entity)
		{
			DAL.DAL.Instance.StoreEntity(entity);
		}
		
		public void DeleteEntityById(Guid entityId)
		{
			DAL.DAL.Instance.DeleteEntityById(entityId);
		}
		
		public void DeleteEntity(EntityBase entity)
		{
			DAL.DAL.Instance.DeleteEntity(entity);
		}
		
		public IList<T> FindEntity<T>(Predicate<T> filter)
		{
			return DAL.DAL.Instance.FindEntity(filter);
		}
	}
}
